package com.hzlh.controller.pc;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzlh.model.TCompanyProduct;
import com.hzlh.model.TFinancingHistory;
import com.hzlh.service.ICompanyProductService;
import com.hzlh.service.IFinancingHistoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/financingHistory")
public class FinancingHistoryController {
    @Resource
    private IFinancingHistoryService financingHistoryService;

    /**
     * 查询企业融资历史列表
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @GetMapping("/getList")
    public PageInfo getList(@RequestParam(value = "pageIndex", defaultValue = "1", required = false) Integer pageIndex,
                            @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize) {
        PageHelper.startPage(pageIndex, pageSize);
        List<TFinancingHistory> list = financingHistoryService.selectList(null);
        return new PageInfo<>(list);
    }
}
